home *** CD-ROM | disk | FTP | other *** search
/ Mac Power 1996 June / MACPOWER-1996-06.ISO.7z / MACPOWER-1996-06.ISO / Apple関連 / OpenDoc J-1.0 / 3rd Party Components / Attachmate CyberTerm / _SOM_ / som_CyberTermInit.cpp < prev    next >
Text File  |  1995-12-04  |  2KB  |  108 lines

  1. /*
  2.     File:        som_CyberTermInit.cpp
  3.  
  4.     Contains:    CFM Library init routines for CyberTerm
  5.  
  6.     Written by:    Steve Smith
  7.  
  8.     Copyright:    ゥ 1995 by Apple Computer, Inc., all rights reserved.
  9.  
  10. */
  11.  
  12.  
  13. // -- Compiler/Preprocessor Switches --
  14.  
  15. #ifndef _COMPILERDEFS_
  16. #include "CompDefs.h"
  17. #endif
  18.  
  19. // -- OpenDoc Utilities --
  20.  
  21. #ifndef _EXCEPT_
  22. // Exceptions define several important macros (ie. CHECKENV)
  23. // which are used in the SOM method dispatch glue. If Except.h
  24. // is not included early enough, exceptions may not be thrown
  25. // correctly when returning from a SOM method with "ev" parameter set.
  26. #include <Except.h>
  27. #endif
  28.  
  29. // -- SOM Includes --
  30.  
  31. #ifndef som_xh
  32. #include <som.xh>
  33. #endif
  34.  
  35. #ifndef SOM_SOMObject_xh
  36. #include <somobj.xh>
  37. #endif
  38.  
  39. // -- CyberTerm Includes --
  40.  
  41. #ifndef SOM_CyberSample_som_CyberTerm_xh
  42. #include "som_CyberTerm.xh"
  43. #endif
  44.  
  45. // -- OpenDoc Utilities --
  46.  
  47. #ifndef _USERSRCM_
  48. #include <UseRsrcM.h>
  49. #endif
  50.  
  51. #ifndef _ODMEMORY_
  52. #include <ODMemory.h>
  53. #endif
  54.  
  55. // -- MacToolbox Includes --
  56.  
  57. #ifndef __CODEFRAGMENTS__
  58. #include <CodeFragments.h>
  59. #endif
  60.  
  61. #pragma segment somCyberTermInit
  62.  
  63. //------------------------------------------------------------------------------
  64. // Prototypes
  65. //------------------------------------------------------------------------------
  66.  
  67. extern "C" pascal OSErr CyberTermCFMInit(CFragInitBlockPtr initBlkPtr);
  68. extern "C" void SOMLINK CyberTermSOMInit( SOMObject *somSelf );
  69.  
  70.  
  71. //------------------------------------------------------------------------------
  72. // Functions
  73. //------------------------------------------------------------------------------
  74.  
  75. extern "C" pascal OSErr CyberTermCFMInit(CFragInitBlockPtr initBlkPtr)
  76. {
  77.     // We are using OpenDoc's memory mgmt calls, so we must
  78.     // initialize the interface to the memory manager.
  79.     OSErr err1 = InitODMemory();
  80.     // We must also capture the relevant information about
  81.     // our library file so that we may access our resources.
  82.     OSErr err2 = InitLibraryResources(initBlkPtr);
  83.  
  84.     // DebugStr("¥pCyberTerm CFM Init!");
  85.     
  86. #if ODDebug
  87.     // DEBUG - drop into debugger if button down when lib loaded.
  88.     if ( Button() ) DebugStr("¥p");
  89. #endif
  90.  
  91.     return (OSErr) (err1 != noErr) ? err1 : err2;
  92. }
  93.  
  94.  
  95. extern "C" void SOMLINK CyberTermSOMInit( SOMObject *somSelf )
  96. {
  97.     
  98. #if ODDebug
  99.     // DEBUG - drop into debugger if button down when lib loaded.
  100.     if ( Button() ) DebugStr("¥p");
  101. #endif
  102.  
  103.     return;
  104. }
  105.  
  106.  
  107.  
  108.